<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
    }

    .large {
      width: 200px;
      height: 200px;
    }

    .left {
      /*
        浮动
         ● 浮动元素会脱离标准流
         ● 浮动元素的层级比标准流中的元素高
         ● 浮动元素的位置，受到前面元素边界的影响
         ● 连续多个浮动元素，会依次排列
         ● 一行可以显示多个浮动元素
         ● 可以设置宽高
       */
      float: left;
    }

    .right {
      float: right;
    }

    .red {
      background-color: red;
    }

    .orange {
      background-color: orange;
    }

    .yellow {
      background-color: yellow;
    }

    .green {
      background-color: green;
    }
  </style>
</head>

<body>
  <div class="left red"></div>
  <div class="left orange"></div>
  <div class="left yellow"></div>
  <div class="right red"></div>
  <div class="right orange"></div>
  <div class="right yellow"></div>
  <div class="large green"></div>
</body>

</html>